package org.chen.jms;

import java.io.Serializable;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;

public class IndexListener implements MessageListener{
	 @Override  
	    public void onMessage(Message msg) {
	        ObjectMessage objMsg=(ObjectMessage) msg;  
	        try {  
	            Serializable obj=objMsg.getObject();  
	            System.out.println(obj);  
	            //TODO 处理独立出去的业务逻辑  
	        } catch (JMSException e) {  
	            e.printStackTrace();  
	        }  
	    }  
}
